package com.llkj.contractmanagement.contractmanagement.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.llkj.contractmanagement.R;
import com.llkj.contractmanagement.customview.RoundImageView;
import com.llkj.contractmanagement.model.ActorBean;
import com.llkj.contractmanagement.utils.ImageLoaderUtil;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * author: dong.yj
 * created on: 2016/8/29 16:46
 * description:我的收藏数据适配器
 */
public class MyCollectionActorAdapter extends CommonBaseAdapter<MyCollectionActorAdapter.ViewHolder,ActorBean.YrlistBean>{


    public MyCollectionActorAdapter(Context context, List<ActorBean.YrlistBean> list) {
        super(context, list);
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int position) {
        return new ViewHolder(inflate(R.layout.lv_browsinghistory_actor_item, null));
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        ActorBean.YrlistBean yrlistBean = mList.get(position);
        holder.tv_actor_name.setText(yrlistBean.getName());
        holder.tv_actor_part.setText(yrlistBean.getPart());
        ImageLoaderUtil.displayHeaderImage(yrlistBean.getLogo(),holder.riv_head_pic);
    }

    static class ViewHolder extends CommonBaseAdapter.ViewHolder {

        @Bind(R.id.riv_head_actor)
        RoundImageView riv_head_pic;
        @Bind(R.id.tv_actor_name)
        TextView tv_actor_name;
        @Bind(R.id.tv_actor_part)
        TextView tv_actor_part;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(view);
        }
    }
}
